import { PagesNavigation } from "@/data/pages/pagesTypes";
import { Navigator, NavigatorProps } from "@tarojs/components";

interface NavigatorPropsNarrowed extends NavigatorProps {
  url: PagesNavigation;
}

const AbstractNavigator = ({
  url,
  children,
  className,
  ...props
}: NavigatorPropsNarrowed) => {
  return (
    <Navigator url={`/${url}`} {...props} className={className}>
      {children}
    </Navigator>
  );
};

export default AbstractNavigator;
